<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>权限申请</title>
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">

<script src="js/jquery.min.js"></script>

<script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>

<!-- jquery-confirm -->
<link href="css/jquery-confirm.css" rel="stylesheet">
<script type="text/javascript" src="js/jquery-confirm.js"></script>

<script type="text/javascript">
	$(function() {
		getUserInfo();
		
		
		$('#right').click(function(){
			$.ajax({
				type : 'POST',
				url : 'share/right.do',
				contentType : 'application/json',
				data : JSON.stringify({}),
				dataType : 'json',
				success : function(data) {
					console.log(data)
					
					$.alert(data.info);
// 					if (data.result == "0") {
// 						$.alert('');
// 					} else {
// 						$('#companyid').html(data['orgCode']);
// 						$('#company').html(data['orgName']);
// 					}
				}
			})
		})
	})
	function getUserInfo() {
		$.ajax({
			type : 'POST',
			url : 'share/getorginfo.do',
			contentType : 'application/json',
			data : JSON.stringify({}),
			dataType : 'json',
			success : function(data) {
				console.log(data)
				if (data.result == "0") {
					$.alert('请先登录');
					$('#right').prop('disabled', true); 
				} else {
					$('#companyid').html(data.datas['orgCode']);
					$('#company').html(data.datas['orgName']);
				}
			}
		})
	}
</script>
</head>
<body>
	<div class="panel panel-primary">
		<div class="panel-heading">
			<h3 class="panel-title">授权信息</h3>
		</div>
		<div class="panel-body">
			<form id="Apply">
				<table class="table table-bordered">
					<tbody>
						<tr>
							<td	style="width: 130px; text-align: right; background-color: #eee;">
								机构代码：</td>
							<td>
								<span id="companyid"></span>
							</td>
							<td	style="width: 130px; text-align: right; background-color: #eee;">
								名称：</td>
							<td>
								<span id="company"></span>
							</td>
						</tr>
						<tr>
							<td	style="width: 130px; text-align: right; background-color: #eee;">
								角色代码：</td>
							<td>
								CSP_015_R00001
							</td>
							<td	style="width: 130px; text-align: right; background-color: #eee;">
								角色名称：</td>
							<td>
								业务申报
							</td>
						</tr>
						<tr>
							<td class="text-center" colspan="4">
								<button id="right" type="button" class="btn btn-primary">授权</button>
							</td>
						</tr>
					</tbody>
				</table>

			</form>
		</div>
	</div>
</body>
</html>